﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace DentistApplication
{
    public static class PatientsHandler
    {

        public static bool addPatient(string firstname, string lastName, string pesel, string idNumber, DateTime birthdate,
            string sex, string phoneNr, string mobileNr, string emailAdd, string street, string zipCode,
            string city, string otherInfo, string bloodGroup)
        {

            Patient p = new Patient
            {
                firstname = firstname,
                lastname = lastName,
                pesel = pesel,
                //idNumber = idNumber,
                birthdate = birthdate,
                sex = sex.Contains("Mężczyzna")?'M':(sex.Contains("Kobieta")?'K':(sex.Contains("Inny")?'I':'O')),
                phoneNumber = phoneNr,
                mobileNumber = mobileNr,
                emailAddress = emailAdd,
                //street = street,
                //zipCode = zipCode,
                //city = city,
                //notes = otherInfo,
                //bloodGroup = bloodGroup
            };

           return DatabaseHandler.addPatientToDatabase(p);
        }


        public static List<Patient> searchForPatients(string name, string lastname, string pesel)
        {

            return DatabaseHandler.searchForPatients(name, lastname, pesel);
        }

        public static List<Patient> getAllPatients()
        {
            return DatabaseHandler.getAllPatients();
        }

        public static List<string> getFieldsInPatientTable()
        {
            return DatabaseHandler.getFieldsInPatientTable();
        }
    }
}
